import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

let routes = [{
		path: '/',
		name: 'home',
		component: _ => import('../views/Home.vue'),
		meta: {
			title: '首页'
		},
	},
	{
		name: 'left',
		path: '/left',
		component: _ => import('../views/LeftView/index.vue'),
		meta: {
			title: 'left'
		},
		children: [{
			name: 'l1',
			path: '/left/l1',
			component: _ => import('../views/LeftView/l1.vue'),
			meta: {
				title: 'left-l1'
			},
			children: [{
				name: 'l11',
				path: '/left/l1/l11',
				component: _ => import('../views/LeftView/l11.vue'),
				meta: {
					title: 'left-l11'
				}
			}, {
				name: 'l12',
				path: '/left/l1/l12',
				component: _ => import('../views/LeftView/l12.vue'),
				meta: {
					title: 'left-l12'
				}
			}]
		}, {
			name: 'l2',
			path: '/left/l2',
			component: _ => import('../views/LeftView/l2.vue'),
			meta: {
				title: 'left-l2'
			},
			children: [{
				name: 'l21',
				path: '/left/l2/l21',
				component: _ => import('../views/LeftView/l21.vue'),
				meta: {
					title: 'left-l21'
				}
			}, {
				name: 'l22',
				path: '/left/l2/l22',
				component: _ => import('../views/LeftView/l22.vue'),
				meta: {
					title: 'left-122'
				}
			}]
		}]
	},
	{
		name: 'right',
		path: '/right',
		component: _ => import('../views/RightView/index.vue'),
		meta: {
			title: 'right'
		},
		children: [{
			name: 'r1',
			path: '/right/r1',
			component: _ => import('../views/RightView/r1.vue'),
			meta: {
				title: 'right-r1'
			},
			children: [{
				name: 'r11',
				path: '/right/r1/r11',
				component: _ => import('../views/RightView/r11.vue'),
				meta: {
					title: 'right-r11'
				}
			}, {
				name: 'r12',
				path: '/right/r1/r12',
				component: _ => import('../views/RightView/r12.vue'),
				meta: {
					title: 'right-r12'
				}
			}]
		}, {
			name: 'r2',
			path: '/right/r2',
			component: _ => import('../views/RightView/r2.vue'),
			meta: {
				title: 'right-r2'
			},
			children: [{
				name: 'r21',
				path: '/right/r2/r21',
				component: _ => import('../views/RightView/r21.vue'),
				meta: {
					title: 'right-r21'
				}
			}, {
				name: 'r22',
				path: '/right/r2/r22',
				component: _ => import('../views/RightView/r22.vue'),
				meta: {
					title: 'right-r22'
				}
			}]
		}]
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})



export default router
